//
//  Movie.m
//  DaHaiDouBan
//
//  Created by dllo on 15/10/31.
//  Copyright © 2015年 Wang Dahai. All rights reserved.
//

#import "Movie.h"

@implementation Movie
- (void)dealloc
{
    [_movieId release];
    [_movieName release];
    [_pic_url release];
    [super dealloc];
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{}
#pragma mark -- 归档第二步:实现协议中编码方法
//对 model 进行编码
-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.movieId forKey:@"movieId"];
    [aCoder encodeObject:self.movieName forKey:@"movieName"];
    [aCoder encodeObject:self.pic_url forKey:@"pic_url"];
}
#pragma mark -- 归档第三步:实现协议中的解码方法
//对 model 进行解码
-(instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.movieId = [aDecoder decodeObjectForKey:@"movieId"];
        self.movieName = [aDecoder decodeObjectForKey:@"movieName"];
        self.pic_url = [aDecoder decodeObjectForKey:@"pic_url"];
        
            }
    return self;
    
}
@end
